<%@ page import="com.bdqn.service.NewsService" %>
<%@ page import="com.bdqn.service.Impl.NewsServiceImpl" %>
<%@ page import="com.bdqn.entity.News" %><%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2021/2/20
  Time: 13:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%--核心标签库--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--格式化标签库--%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
   /* String path = request.getContextPath();
    String basePath = request.getServerName() + ":" + request.getServerPort() + path + "/";
    String baseUrlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    pageContext.setAttribute("baseUrlPath", baseUrlPath);
    //获取请求时传来的新闻编号
    request.getParameter("id");
    //获取newsServiceImpl的对象
    NewsService newsService=new NewsServiceImpl();
    News news = newsService.queryNewsById(Integer.parseInt(request.getParameter("id")));
    //把news对象存到page作用域中，键值对
    pageContext.setAttribute("news",news);*/
%>
<html>
<head>
    <title>新闻详情页</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/common.css">
    <style>
        .picPathImg{
            display: block;
            margin: 10px auto;
            width: 200px;
        }
    </style>
</head>
<body>
<div class="main-content-right">
    <div class="main-text-box">
        <div class="main-text-box-tbg">
            <div class="main-text-box-bbg">
                <div class="article-box">
                    <!--新闻的标题-->
                    <h1>${news.title}</h1>
                    <div class="source-bar">发布者：
                        ${news.author}
                        <%--<%=news.getAuthor()%>>--%>
                        分类：新闻信息
                        更新时间：${news.createDate}<%--<%=news.getCreateDate()%>--%></div>
                    <div class="article-content">
                        <span class="article-summary"><b>摘要：${news.summary}<%--<%=news.getSummary()%>--%></b></span>
                        <c:choose>
                            <c:when test="${empty news.getPicPath()}">
                                新闻图片：暂无
                            </c:when>
                            <c:otherwise>
                                <img class="picPathImg" alt="图片未找到" src="<%=request.getContextPath() %>/static/upload/${news.picPath}<%--<%=news.getPicPath()%>--%>"/>
                            </c:otherwise>
                        </c:choose>
                        <%--<%
                            if(news.getPicPath()==null || news.getPicPath().equals("")){
                        %>
                        新闻图片：暂无
                        <%
                            }else{
                        %>
                        <img class="picPathImg" src="<%=request.getContextPath() %>/static/upload/${news.picPath}&lt;%&ndash;<%=news.getPicPath()%>&ndash;%&gt;"/>
                        <%
                            }
                        %>--%>
                        <br/>
                        <%--${news.content}--%>
                       <%--<%=news.getContent()%>--%>
                        <c:out value="${news.content}" escapeXml="false"></c:out>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
